package Three_ZhuChangShuang.menu;

import Three_ZhuChangShuang.service.AdminService;

import java.util.Scanner;

/**
 * @Author zhu
 * @Date 2021/3/24 16:13
 * @ClassNmae AdminMenu
 * @Description 管理员菜单
 */
public class AdminMenu {
    Scanner scanner = new Scanner(System.in);
    AdminService adminService;

    public AdminService getAdminService() {
        return adminService;
    }

    public void setAdminService(AdminService adminService) {
        this.adminService = adminService;
    }

    public void adminView() {
        boolean isExit = false;
        while (!isExit) {
            System.out.println("=====================================================================");
            System.out.println("请选择：\t 1.疫苗接种 \t 2.查看预约用户 \t 3.查看已接种用户 \t 4.退出登录");
            System.out.println("=====================================================================");
            try {
                int choose = Integer.parseInt(scanner.next());
                switch (choose) {
                    case 1: {
                        adminService.vaccination();
                        break;
                    }
                    case 2: {
                        adminService.appointmentView();
                        break;
                    }
                    case 3: {
                        adminService.inoculationView();
                        break;
                    }
                    case 4: {
                        System.out.println("退出登录");
                        return;
                    }
                    default: {
                        System.out.println("请输入1——4之间的数字选项！");
                    }
                }
            } catch (Exception e) {
                //e.printStackTrace();
                System.out.println("请输入1——4之间的数字选项！");
            }

        }
    }
}
